package Test::Fixture::RecipeTest;

use strict;
use warnings;

use XML::Simple;
use Data::Dumper;

sub new {
   # XXX: positional constructors are bad
   my ( $class, $xml_file ) = @_;
   my $xml = XMLin( $xml_file );

   #print Dumper($xml);

   my $self = {'_doc' => $xml};
   bless $self, $class;
   return $self;
}

sub get_html {
    my ($self) = @_;
    return $self->{'_doc'}->{'html'};
}

sub get_name {
    my ($self) = @_;
    return $self->{'_doc'}->{'name'};
}

sub get_ingredients {
    my ($self) = @_;
    return @{$self->{'_doc'}->{'ingredients'}->{'ingredient'}};
}

sub get_description {
    my ($self) = @_;
    return $self->{'_doc'}->{'description'};
}

sub get_preparation {
    my ($self) = @_;
    return $self->{'_doc'}->{'preparation'};
}

1;
